package com.cby.android.sample.fragments

import android.os.Bundle
import com.cby.android.library.base.BasePageStateFragment
import com.cby.android.sample.adapter.RollNewsAdapter
import com.cby.android.sample.adapter.SquareListAdapter
import com.cby.android.sample.bean.MetaImageBean
import com.cby.android.sample.bean.roll.RollNewsInfoBean
import com.cby.android.sample.model.RollNewsListViewModel
import com.cby.android.sample.model.SquareListViewModel
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @description: RollNewsListFragment
 *
 * @author ChenBaoyang
 * @date 4/29/21 10:33
 */
class SquareListFragment : BasePageStateFragment<SquareListViewModel, MetaImageBean>() {

    private var keyword: String = "美女"

    companion object{
        const val KEY_WORD = "keyword"

        fun newInstance(keyword: String): SquareListFragment{
            val fragment = SquareListFragment()
            val data = Bundle()
            data.putString(KEY_WORD, keyword)
            fragment.arguments = data
            return fragment
        }
    }

    override fun parseArgs() {
        keyword = requireArguments().getString(KEY_WORD).toString()
    }

    override fun loadData() {
        viewModel!!.keyword = keyword
        super.loadData()
    }

    override fun getAdapter() = SquareListAdapter()

}